package entity;

import com.alibaba.fastjson.annotation.JSONField;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.springframework.format.annotation.DateTimeFormat;

import java.io.Serializable;
import java.text.Format;
import java.time.LocalDateTime;
import java.util.Date;

/**
 * Author：汤小洋
 * Date：2023-09-21 9:40
 * Description：<描述>
 */
@Data
@NoArgsConstructor
@AllArgsConstructor
public class User implements Serializable {
    private Integer id;
    private String username;
    private String password;
    private Integer age;
    private Double height;

    // @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8") // jackson
    @JSONField(format = "yyyy-MM-dd HH:mm:ss") // fastjson
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss") // 接收时的日期格式
    private LocalDateTime birthday;
}
